//package org.dialMsg.Server.ServerImp;
//
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//
//import java.util.Map;
//
///**
// * @author DPF
// */ // 添加线程池监控端点
//@Endpoint(id = "threadpool")
//public class ThreadPoolEndpoint {
//    private final ThreadPoolTaskExecutor executor;
//
//    public ThreadPoolEndpoint(ThreadPoolTaskExecutor executor) {
//        this.executor = executor;
//    }
//
//    @ReadOperation
//    public Map<String, Object> metrics() {
//        Map<String, Object> metrics = new HashMap<>();
//        metrics.put("activeCount", executor.getActiveCount());
//        metrics.put("corePoolSize", executor.getCorePoolSize());
//        metrics.put("poolSize", executor.getPoolSize());
//        metrics.put("queueSize", executor.getThreadPoolExecutor().getQueue().size());
//        metrics.put("completedTaskCount", executor.getThreadPoolExecutor().getCompletedTaskCount());
//        return metrics;
//    }
//}